Hi,
you can reference the document by using the name of the datasource:
<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:this.data>
<xp:dominoDocument var="document1"
postNewDocument="#{javascript:viewScope.id = document1.getDocument().getUniversalID();}">
</xp:dominoDocument>
</xp:this.data>
<xp:label value="#{javascript:viewScope.id}" id="label1"></xp:label>
</xp:view>
Hope this helps
Sven